import request from '@/utils/request'
import { otherFiltersItem } from '@/utils'

/**
 * 变更形象督导
 * @param {*} data
 * @returns
 */
export function postChangeSupervisor(data) {
  return request({
    url: '/api/v1/shopSoftwearDisplay/changeSupervisor',
    method: 'POST',
    data
  })
}
/**
 * 软装陈列开始时间
 * @param {*} data
 * @returns
 */
export function postDisplay(data) {
  return request({
    url: '/api/v1/shopSoftwearDisplay/display',
    method: 'POST',
    data
  })
}
/**
 * 初检
 * @param {*} data
 * @returns
 */
export function postFirstCheck(data) {
  return request({
    url: '/api/v1/shopSoftwearDisplay/firstCheck',
    method: 'POST',
    data
  })
}
/**
 * 获取详情
 * @param {*} id
 * @returns
 */
export function getDetail(id) {
  return request({
    url: `/api/v1/shopSoftwearDisplay/getOne/${id}`,
    method: 'GET'
  })
}
/**
 * 复检
 * @param {*} data
 * @returns
 */
export function postReCheck(data) {
  return request({
    url: `/api/v1/shopSoftwearDisplay/reCheck`,
    method: 'POST',
    data
  })
}
/**
 * 客户经理自检
 * @param {*} data
 * @returns
 */
export function selfCheck(data) {
  return request({
    url: `/api/v1/shopSoftwearDisplay/customerManagerSelfChecking`,
    // /?id=${data.id}&selfCheckingTime =${data.selfCheckingTime}&demandToStoreDisplayTime=${data.demandToStoreDisplayTime}`,
    method: 'POST',
    data
  })
}
/**
 * 形象督导自检资料审核
 * @param {*} data
 * @returns
 */
export function selfCheckAudit(data) {
  return request({
    url: `/api/v1/shopSoftwearDisplay/imageSupervisionSelfChecking`,
    // /?id=${data.id}&estimateToStoreDisplayTime=${data.estimateToStoreDisplayTime}&selfCheckingVerifyRemarks=${data.selfCheckingVerifyRemarks}&selfCheckingVerifyResult=${data.selfCheckingVerifyResult}`,
    method: 'POST',
    data
  })
}
/**
 * 根据所属模块获取文件列表
 * @returns
 */
export function postConfigAttachmentTemplate() {
  const data = new FormData()
  data.append('filtersRaw', JSON.stringify([otherFiltersItem('belongModel', 'SHOP_SOFTWEAR_DISPLAY', '=')]))
  return request({
    url: '/api/v1/configAttachmentTemplate/page',
    method: 'POST',
    data
  })
}

/**
 * 根据所属id获取文件列表
 * @returns
 */
export function getShopAttachment(id) {
  const data = new FormData()
  data.append('pageFlag', false)
  data.append('filtersRaw', JSON.stringify([otherFiltersItem('modelId', id, '=')]))
  return request({
    url: '/api/v1/shopAttachment/page',
    method: 'POST',
    data
  })
}
